<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"/>
    <title>Title</title>
</head>
<body>
<table border="1">
    <tr>
        <td>商品标题</td>
        <td>商品名称</td>
        <td>商品价格</td>
        <td>商品优惠价格</td>
        <td>商品创建时间</td>
        <td>商品状态</td>
        <td>操作</td>
    </tr>
    <tr th:each="entity:${list}">
        <td th:text="${entity.producttitle}"></td>
        <td th:text="${entity.productname}"></td>
        <td th:text="${entity.productprice}"></td>
        <td th:text="${entity.productdiscounts}"></td>
        <td th:text="${entity.createTime}"></td>
        <td th:text="${entity.state}"></td>
        <td>
            <span th:switch="${entity.state}">
                <span th:case=0><a href="#" th:href="@{/productControl/updateState(state=1,id=${entity.id})}" >审核通过</a>||<a href="#" th:href="@{/productControl/updateState(state=2,id=${entity.id})}">不通过</a></span>
                <span th:case=1><a href="#" th:href="@{/productControl/updateState(state=3,id=${entity.id})}" >上架</a>||<a href="#" th:href="@{/productControl/updateState(state=4,id=${entity.id})}" >下架</a></span>
            </span>
        </td>
    </tr>
</table>
</body>
</html>